<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of welcome
 *
 * @author Obi
 */
class Kontak extends MY_Controller {

    function __construct() {
        parent::__construct();
        $this->mkontak = new M_kontak();
    }

    function index() {

        $data['menu'] = array(
            $this->load->view('parsing/client/menu_right_katagori', '', true),
            $this->load->view('parsing/client/menu_right_db', '', true),
        );

        $data['title'] = "Kontak Kami";
        $data['isi'] = 'isi_kontak';
        $data['alert'] = '';

        $this->load->view('template_client', $data);
    }

    function simpan() {

        $data = array(
            'nama_pengirim' => $this->input->post('nama_pengirim'),
            'email' => $this->input->post('email'),
            'telp' => $this->input->post('telp'),
            'pesan' => $this->input->post('pesan'),
            'tanggal' => date('Y-m-d H:i:s')
        );

        $this->mkontak->insert($data);


        $data['menu'] = array(
            $this->load->view('parsing/client/menu_right_search', '', true),
            $this->load->view('parsing/client/menu_right_katagori', '', true),
            $this->load->view('parsing/client/menu_right_db', '', true),
        );

        $data['title'] = "Kontak Kami";
        $data['isi'] = 'isi_kontak';

        $this->load->view('template_client', $data);

        redirect("main/kontak/kontak_save/13");
    }

    function kontak_save($alert = NULL) {
        $data['menu'] = array(
            $this->load->view('parsing/client/menu_right_katagori', '', true),
            $this->load->view('parsing/client/menu_right_db', '', true),
        );

        $data['title'] = "Kontak Kami";
        $data['isi'] = 'isi_kontak';
        $data['alert'] = $alert;

        $this->load->view('template_client', $data);
    }

}

?>
